name: 远程部署SpringBoot
description: 自动部署SpringBoot项目，同时监控日志

workflow:
  start:
    type: start
    targets:
      - "ssh_cmd"
  # 部署SpringBoot 项目
  ssh_cmd:
    sources:
      - "start"
    targets:
      - "http_get"
    type: ssh_cmd:1.0.1
    param:
      ssh_private_key: "((private_key.jianmu))"
      ssh_port: "22"
      ssh_cmd: "nohup java -jar /opt/module/springboot-web-login-simple-0.1.jar > /opt/module/logs/springboot.log 2>&1 &"
      ssh_ip: "192.168.25.128"
      ssh_user: "uni"
  #测试HTTP请求
  http_get:
    sources:
    - "ssh_cmd"
    targets:
    - "wechat"
    type: "ethan/http_get:0.0.3"
    param:
      api_url: "-k http://192.168.25.128:8080/check"
      jq_exp: ".status"
  # 使用企业微信WebHook
  wechat:
      type: qywx_notice:1.2.1
      param:
        bot_webhook_url: "((wechat.bot_xiaolan))"
        text_content: "SpringBoot项目部署结果: ${workflow.http_get.api_result}"
      sources:
        - "http_get"
      targets:
        - "end"
  end:
    type: end
    sources:
      - "wechat"